-----------------------------------
-- Area: Dynamis - San d'Oria
--  NM:  Overlord's Tombstone
-- @zone 185
-- @pos 0.027, -2.000, 42.099
-----------------------------------

require("scripts/globals/titles");
require("scripts/globals/dynamis");

-----------------------------------
-- onMobSpawn Action
-----------------------------------

function OnMobSpawn(mob)
end;

-----------------------------------
-- onMobEngaged
-----------------------------------

function onMobEngaged(mob,target)
	SpawnMob(17535350):updateEnmity(target); -- 110
	SpawnMob(17535351):updateEnmity(target); -- 111
	SpawnMob(17535352):updateEnmity(target); -- 112
	SpawnMob(17535354):updateEnmity(target); -- 114
	SpawnMob(17534978):updateEnmity(target); -- Battlechoir Gitchfotch
	SpawnMob(17534979):updateEnmity(target); -- Soulsender Fugbrag

end;

-----------------------------------
-- onMobDeath
-----------------------------------

function onMobDeath(mob,killer)

	if(alreadyReceived(killer,8) == false) then
		addDynamisList(killer,128);

		killer:addTitle(DYNAMISSAN_DORIA_INTERLOPER); -- Add title

		local npc = GetNPCByID(17535223); -- Spawn ???
		npc:setPos(mob:getXPos(),mob:getYPos(),mob:getZPos());
		npc:setStatus(0);

		killer:launchDynamisSecondPart(); -- Spawn Dynamis - second part
	end

	for i = 17534978, 17534979 do
      if (GetMobAction(i) ~= 0) then
         DespawnMob(i);
      end
	end

end;